<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AttackDiceTest</title>

<link rel="stylesheet"
	href="http://code.jquery.com/qunit/qunit-1.15.0.css">
<script src="http://code.jquery.com/qunit/qunit-1.15.0.js"></script>

<script src="../../main/js/util/Logger.js"></script>

<script src="../../main/js/AttackDice.js"></script>

<script>
    var LOGGER = new Logger();

    QUnit.test("AttackDice properties", function(assert)
    {
        var dice = new AttackDice(3);
        assert.ok(dice.getValue(0));
        assert.ok(dice.getValue(1));
        assert.ok(dice.getValue(2));
    });

    QUnit.test("AttackDice.getBlankCount()", function(assert)
    {
        var dice = new AttackDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == AttackValue.BLANK)
        {
            assert.equal(dice.getBlankCount(), 1);
        }
        else
        {
            assert.equal(dice.getBlankCount(), 0);
        }
    });

    QUnit.test("AttackDice.getCriticalHitCount()", function(assert)
    {
        var dice = new AttackDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == AttackValue.CRITICAL_HIT)
        {
            assert.equal(dice.getCriticalHitCount(), 1);
        }
        else
        {
            assert.equal(dice.getCriticalHitCount(), 0);
        }
    });

    QUnit.test("AttackDice.getFocusCount()", function(assert)
    {
        var dice = new AttackDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == AttackValue.FOCUS)
        {
            assert.equal(dice.getFocusCount(), 1);
        }
        else
        {
            assert.equal(dice.getFocusCount(), 0);
        }
    });

    QUnit.test("AttackDice.getHitCount()", function(assert)
    {
        var dice = new AttackDice(1);
        LOGGER.trace("dice = " + dice);
        if (dice.getValue(0) == AttackValue.HIT)
        {
            assert.equal(dice.getHitCount(), 1);
        }
        else
        {
            assert.equal(dice.getHitCount(), 0);
        }
    });
</script>
</head>
<body>
	<div id="qunit"></div>
</body>
</html>
